package com.yuyue.dronesystem.beans;

import java.util.Objects;

/**
 * Container
 */
public class Container extends Box {

    // 集装箱外部尺寸
    private Box outside = new Box();
    // 集装箱门尺寸
    private Box door = new Box();

    public Container() {
    }

    public Container(Box outside, Box door) {
        this.outside = outside;
        this.door = door;
    }

    public Container(Box inside, Box outside, Box door) {
        super(inside);
        this.outside = outside;
        this.door = door;
    }

    public Box getOutside() {
        return this.outside;
    }

    public void setOutside(Box outside) {
        this.outside = outside;
    }

    public Box getDoor() {
        return this.door;
    }

    public void setDoor(Box door) {
        this.door = door;
    }

    public Container outside(Box outside) {
        this.outside = outside;
        return this;
    }

    public Container door(Box door) {
        this.door = door;
        return this;
    }

    @Override
    public boolean equals(Object o) {
        if (o == this)
            return true;
        if (!(o instanceof Container)) {
            return false;
        }
        Container container = (Container) o;
        return super.equals((Box) o) && Objects.equals(outside, container.outside) && Objects.equals(door, container.door);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), outside, door);
    }

    @Override
    public String toString() {
        return "{" +
            " inside='" + super.toString() + "'" +
            ", outside='" + getOutside() + "'" +
            ", door='" + getDoor() + "'" +
            "}";
    }
}